package com.example.lottery_system.service.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

@AllArgsConstructor
@Getter
public enum ActivityStatus {
    RUNNING(1, "活动进行中"),
    COMPLETED(2, "活动已完成");
    private final Integer code;
    private final String message;

    public static ActivityStatus forName(String name) {
        for(ActivityStatus activityStatus : ActivityStatus.values()) {
            if(activityStatus.name().equalsIgnoreCase(name)) {
                return activityStatus;
            }
        }
        return null;
    }
}
